﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiImageBackgroundTraits : OdGiDrawableTraits
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiImageBackgroundTraits(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiImageBackgroundTraits_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiImageBackgroundTraits obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiImageBackgroundTraits()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiImageBackgroundTraits(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGiImageBackgroundTraits cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiImageBackgroundTraits_cast(OdRxObject.getCPtr(pObj));
			OdGiImageBackgroundTraits result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiImageBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiImageBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiImageBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiImageBackgroundTraits_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiImageBackgroundTraits_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiImageBackgroundTraits_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdGiImageBackgroundTraits createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiImageBackgroundTraits_createObject();
			OdGiImageBackgroundTraits result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiImageBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiImageBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiImageBackgroundTraits)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setImageFilename(string filename)
		{
			GlobalsPINVOKE.OdGiImageBackgroundTraits_setImageFilename(this.swigCPtr, filename);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual string imageFilename()
		{
			string result = GlobalsPINVOKE.OdGiImageBackgroundTraits_imageFilename(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setFitToScreen(bool bFitToScreen)
		{
			GlobalsPINVOKE.OdGiImageBackgroundTraits_setFitToScreen(this.swigCPtr, bFitToScreen);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool fitToScreen()
		{
			bool result = GlobalsPINVOKE.OdGiImageBackgroundTraits_fitToScreen(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setMaintainAspectRatio(bool bMaintainAspectRatio)
		{
			GlobalsPINVOKE.OdGiImageBackgroundTraits_setMaintainAspectRatio(this.swigCPtr, bMaintainAspectRatio);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool maintainAspectRatio()
		{
			bool result = GlobalsPINVOKE.OdGiImageBackgroundTraits_maintainAspectRatio(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setUseTiling(bool bUseTiling)
		{
			GlobalsPINVOKE.OdGiImageBackgroundTraits_setUseTiling(this.swigCPtr, bUseTiling);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool useTiling()
		{
			bool result = GlobalsPINVOKE.OdGiImageBackgroundTraits_useTiling(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setXOffset(double xOffset)
		{
			GlobalsPINVOKE.OdGiImageBackgroundTraits_setXOffset(this.swigCPtr, xOffset);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double xOffset()
		{
			double result = GlobalsPINVOKE.OdGiImageBackgroundTraits_xOffset(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setYOffset(double yOffset)
		{
			GlobalsPINVOKE.OdGiImageBackgroundTraits_setYOffset(this.swigCPtr, yOffset);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double yOffset()
		{
			double result = GlobalsPINVOKE.OdGiImageBackgroundTraits_yOffset(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setXScale(double xScale)
		{
			GlobalsPINVOKE.OdGiImageBackgroundTraits_setXScale(this.swigCPtr, xScale);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double xScale()
		{
			double result = GlobalsPINVOKE.OdGiImageBackgroundTraits_xScale(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setYScale(double yScale)
		{
			GlobalsPINVOKE.OdGiImageBackgroundTraits_setYScale(this.swigCPtr, yScale);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double yScale()
		{
			double result = GlobalsPINVOKE.OdGiImageBackgroundTraits_yScale(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
